Clarify script entry point targets#2060
Open
Herrtian wants to merge 2 commits into
Open
Conversation
woodruffw
reviewed
Jun 5, 2026
| will be available. Executing this command will do the equivalent of | ||
| ``import sys; from spam import main_cli; sys.exit(main_cli())``. | ||
|
|
||
| Script entry points must use the ``module:object`` form. The object |
Member
There was a problem hiding this comment.
Per EPS, this is called an "object reference." I think we should probably use that language consistently and link to it as well:
Suggested change
| Script entry points must use the ``module:object`` form. The object | |
| Script entry points are written as object references like ``importable.module``, or importable.module:object.attr``. The object |
Ref: https://packaging.python.org/en/latest/specifications/entry-points/#data-model
woodruffw
reviewed
Jun 5, 2026
Comment on lines
+212
to
+213
| reference should point to a function that can be called with no arguments, | ||
| not to a module by itself. |
Member
There was a problem hiding this comment.
This is de facto true (I think), but in principle I think script entry points can be modules if the user does something cursed like forcefully instantiating a callable module instance.
Not sure if that's worth qualifying though, the "should" is probably good enough 🙂
Contributor
Author
|
Updated this to use the object reference terminology, link to the entry points spec, and avoid requiring the target to be strictly a function. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1993.
Summary:
Checks:
📚 Documentation preview 📚: https://python-packaging-user-guide--2060.org.readthedocs.build/en/2060/